import { Injectable, Logger } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { ConfigService } from '@nestjs/config';
import { BaseService } from '@wwjCommon/base/base.service';
import { CacheService } from '@wwjCommon/cache/cache.service';
import { LoggingService } from '@wwjCommon/logging/logging.service';
import { UploadService } from '@wwjVendor/upload/upload.service';
import { PayService } from '@wwjVendor/pay/pay.service';
import { SmsService } from '@wwjVendor/sms/sms.service';
import { NoticeService } from '@wwjVendor/notice/notice.service';

@Injectable()
export class AliappConfigService extends BaseService<any> {
  private readonly logger = new Logger(AliappConfigService.name);

  constructor(
    @InjectRepository(Object)
    protected readonly repository: Repository<any>,
    private readonly cacheService: CacheService,
    private readonly configService: ConfigService,
    private readonly loggingService: LoggingService,
    private readonly uploadService: UploadService,
    private readonly payService: PayService,
    private readonly smsService: SmsService,
    private readonly noticeService: NoticeService,
  ) {
    super(repository);
  }

  /**
   * getAliappConfig
   * 对应 PHP: AliappConfigService_admin::getAliappConfig()
   * 逻辑类型: undefined - undefined
   */
  async getAliappConfig() {
    // 基于PHP真实逻辑: getAliappConfig
    // PHP原文: return (new CoreAliappConfigService())->getAliappConfig($this->site_id);     }      /**      * 设置配置      * @param array $data      * @return SysConfig...
return this.coreAliappConfigService.getAliappConfig(this.site_id);
    }

    /**
     * 设置配置
     * @param data
     * @return SysConfig|bool|Model
     */
    async setAliappConfig(data){
        return this.coreAliappConfigService.setAliappConfig(this.site_id, data);
    }

    /**
     * 服务器域名
     * @return */
    async static(){
        const domain = request().domain(];
        return [
            domain: domain,
        );

    }

}
  }

  /**
   * setAliappConfig
   * 对应 PHP: AliappConfigService_admin::setAliappConfig()
   * 逻辑类型: undefined - undefined
   */
  async setAliappConfig(data: any[]) {
    // 基于PHP真实逻辑: setAliappConfig
    // PHP原文: return (new CoreAliappConfigService())->setAliappConfig($this->site_id, $data);     }      /**      * 服务器域名      * @return array      */     public fu...
return this.coreAliappConfigService.setAliappConfig(this.site_id, data);
    }

    /**
     * 服务器域名
     * @return */
    async static(){
        const domain = request().domain(];
        return [
            domain: domain,
        );

    }

}
  }

  /**
   * static
   * 对应 PHP: AliappConfigService_admin::static()
   * 逻辑类型: undefined - undefined
   */
  async static() {
    // 基于PHP真实逻辑: static
    // PHP原文: $domain = request()->domain();         return [             'domain' => $domain,         ];      }  }...
const domain = request().domain(];
        return [
            domain: domain,
        );

    }

}
  }
}
